/**
 * @Author: Bobby
 * @Date: 2022-02-15 13:14:17
 * @LastEditTime: 2022-03-04 13:53:09
 * @LastEditors: Bobby
 * @Description:
 * @FilePath: \wms-v2\src\ve\common\components\baseComs\form\uiUpload.js
 * @CIMC-V2
 */
import { exInput, exSwitch, exTextarea, exValidateSelect, exSelect, exRequestData } from '@ve/common/components/extension'

export default {
  VERSION: '20220408',
  type: 'uiUpload',
  name: '上传',
  icon: 'file-upload-line',
  svg: 'shangchuan',
  //数据别名
  // dataName: 'uiUpload_data',
  //数据集合 表单 列表等等
  data: {
    requestData: {},
  },
  extension: {
    model: exInput('Model', 'upload_name'),
    label: exInput('标签', '上传'),
    //rule: exSwitch('验证', false),
    extendRule: exValidateSelect('', {}, []),
    tooltip: exTextarea('弹窗提示', '', '', 3),
    api: exInput('上传地址', ''),
    method: exInput('method', ''),
    echoMethod: exInput('查询文件method', ''),
    downloadMethod: exInput('预览method', ''),
    deleMethod: exInput('删除method', ''),
    // param: exInput('上传参数', '', 'json字符串'),
    btnName: exInput('上传按钮名称', '上传文件'),
    fileShow: exSwitch('显示文件列', true),
    limit: {
      type: 'exInputNumber',
      name: '文件上传数',
      value: 1,
      min: 1,
      max: 50,
    },
    listType: exSelect('文件展示类型', 'text', [
      { value: 'text', label: '默认（文本）' },
      // { value: 'picture', label: '缩略图列表' },
      { value: 'picture-card', label: '图片列表' },
    ]),
    requestData: exRequestData(
      '回显参数',
      [
        { key: '#LIMIT#', value: 1 },
        { key: '#PAGE_SIZE#', value: 50 },
        { key: 'BUSINESS_TYPE', value: 1 },
      ],
      '回显所需参数'
    ),
    // multiple: exSwitch('多选文件', false),
    backgroundSet: {
      type: 'exBigImage',
      name: '背景图配置',
      value: {
        // api: '',
        // method: '',
        // imgMethod: '',
        url: '',
      },
    },
    // imgSwitch: exSwitch('图片模式', false),
    name: 'uploadFile',
    width: exInput('宽度', '150px'),
    height: exInput('高度', '150px'),
    disabled: exSwitch('禁用', false),
    hidden: exSwitch('隐藏', false),
    accept: exInput('文件类型', '*', '文件后缀；举例:.pdf,.xlsx'),
    getTableData: {
      type: 'exGetDownload',
      name: '绑定数据表格',
      title: '绑定数据表格',
      value: [],
      hasCheckbox: false,
      treeData: '$getPageModules',
    },
  },
  //交互
  interaction: [],
  //条件、逻辑指令
  logicInstruction: [],
}
